package cloudeval.spec.metrics

import cn.edu.neu.vmmigeval.cloud.entity.DataCenter
import cn.edu.neu.vmmigeval.cloud.entity.DataCenterBroker
import cn.edu.neu.vmmigeval.evaluation.Measure
import cn.edu.neu.vmmigeval.evaluation.PowerModel

/**
 * The simple power model.
 *
 * @author yfwz100
 */
class SimplePowerModel implements Measure {

    private double totalEnergy

    @Override
    void process(int clock, DataCenterBroker dcb, DataCenter dc) {
        PowerModel pm = new PowerModel();
        //TODO power strategy name?
        totalEnergy += pm.getPower(clock, dc, "", "default");
    }

    @Override
    double getValue() {
        return totalEnergy
    }

    @Override
    String toString() {
        return "Power: ${getValue()}"
    }
}
